home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
dbms_mag
/
9104
/
foxpro.apr
< prev
next >
Wrap
Text File
|
1991-03-26
|
2KB
|
87 lines
*** Listing 1
USE Timelog && See structure in Figure 1
ZAP
APPEND FROM D:\Timelog.sdf TYPE SDF
SET TALK OFF && Optional
lasttime = Seconds
SKIP -1
DO WHILE .NOT. BOF()
IF m->lasttime < Seconds
&& For the late night programmers
&& (Seconds() returns seconds since midnight)
REPLACE Elapsed WITH m->lasttime+86400 - Seconds
ELSE
REPLACE Elapsed WITH m->lasttime - Seconds
ENDIF
lasttime = Seconds
SKIP -1
ENDDO
REPLACE Lines WITH 1 ALL
*** Listing 2
USE Prcsumry INDEX Prcsumry && Indexed on
Procname+Procfile
ZAP
handle = FOPEN('PRCSUMRY.DOC')
FOR i = 1 TO 7
=FGETS(m->handle) && Skip this text
ENDFOR
textstr = FGETS(m->handle)
procfiles = VAL(LEFT(m->textstr,AT(' ',m->textstr)-1))
FOR i = 1 TO m->procfiles + 2
=FGETS(m->handle) && Skip this text
ENDDO
FOR i = 1 TO m->procfiles
textstr = FGETS(m->handle)
procfile = LEFT(m->textstr,AT(' ',m->textstr)-1)
=FGETS(m->handle) && Skip this text
DO WHILE .NOT. EMPTY(m->textstr)
textstr = ALLTRIM(FGETS(m->handle))
IF LEFT(m->textstr,10)='Contains: '
procname = STRTRAN(SUBSTR(m->textstr,11,;
AT('',m->textstr,2)-11),'()','')
APPEND BLANK
GATHER MEMVAR
ENDIF
ENDDO
=FGETS(m->handle) && Skip this text
=FGETS(m->handle) && Skip this text
ENDFOR
CLOSE ALL
*** Listing 3
SELECT 2
USE Prcsumry INDEX Prcsumry
SELECT 1
USE Timelog
SET RELATION TO Program INTO Prcsumry
INDEX ON Prcsumry->Procfile+Lineno TO Temp ;
FOR .NOT. EMPTY(Prcsumry->Procfile)
DO WHILE .NOT. EOF()
procfile = Prcsumry->Procfile
handle = FOPEN(m->Procfile)
filesize = FSEEK(m->handle,0,2)
=FSEEK(m->handle,0) && beginning of file
bytesread = 0
lineno = 1
DO WHILE bytesread < m->filesize
code = FGETS(m->handle,1024)
IF SEEK(m->procfile+STR(m->lineno,5))
REPLACE Code WITH m->code
ENDIF
bytesread = m->bytesread + LEN(m->code)+2
lineno = m->lineno + 1
ENDDO
SEEK Prcsumry->Procfile
LOCATE FOR Prcsumry->Procfile <> m->procfile REST
ENDDO